package day16.xianchengdemo.executorService;

import java.util.concurrent.Callable;

class MyCallable implements Callable<String>//普通任务类
{   private int n;
    MyCallable(){}
    public MyCallable(int n){this.n=n;}
    public String call()throws Exception
    {     int sum=0;
        for(int i = 1;i <= this.n;i++)
        {
            sum+=i;
            // System.out.println("子线程");
        }
        return "子线程1："+"n="+n+"的计算结果是："+sum;
    }

}